#include "config.h"
#ifndef __DEBUG
    #pragma config FOSC = INTIO67
#else
    #pragma config FOSC = INTIO7
#endif

void init_MicroController()
{
#if FOSC_INT_HF
    #if FOSC_INT_HF_16MHz
        OSCCONbits.IRCF = 0x7;
    #elif FOSC_INT_HF_8MHz
        OSCCONbits.IRCF = 0x6;
    #elif FOSC_INT_HF_4MHz
        OSCCONbits.IRCF = 0x5;
    #elif FOSC_INT_HF_2MHz
        OSCCONbits.IRCF = 0x4;
    #else
        OSCCONbits.IRCF = 0x3;
    #endif
#elif FOSC_INT_MF
    #if FOSC_INT_MF_500kHz
        OSCCONbits.IRCF = 0x2;
        OSCCON2bits.MFIOSEL = 1;
    #elif FOSC_INT_MF_250kHz
        OSCCONbits.IRCF = 0x1;
        OSCCON2bits.MFIOSEL = 1;
    #else
        OSCCONbits.IRCF = 0x0;
        OSCCON2bits.MFIOSEL = 0;
    #endif
#else
    OSCCONbits.IRCF = 1;
#endif

    OSCCONbits.IDLEN = 0;
}